{% extends 'base.html' %}
{% include 'link_css.html' %}
{% block content %}


<div class="text-center">
<form  class="col-lg-12" action="{% url 'kettle_execute' %}" method="post">
     <fieldset class="form-group">
        <label for="formGroupExampleInput">脚本类型</label>
        <select id="type" class="selectpicker form-control" data-live-search="true" name="type"  onchange="getoption(this.value)">
          <option value="none"></option>
          <option value="1">ktr</option>
          <option value="2">kjb</option>
        </select>
     </fieldset>

     <fieldset class="form-group">
        <label for="formGroupExampleInput">脚本路径</label>
        <input type="text" class="form-control" id="file" placeholder="erp/erp_order_cancel_etl.ktr
    " name="file" required="">
    </fieldset>

     <fieldset class="form-group">
        <label for="formGroupExampleInput">输出日志文件名</label>
        <input type="text" class="form-control" id="formGroupExampleInput" placeholder="erp_order_cancel_etl.log
    " name="kettle_log_file" required="">
    </fieldset>

    <input  id="sub" class="btn btn-danger" type="submit" value="run" disabled="disabled">
</form>


<script>
    function getoption(val) {
        var type = document.getElementById("type").value;
        if (type != "none") {
            $("#sub").attr("disabled", false)       
        }
        else{
            $("#sub").attr("disabled", true)  
        }
    }
</script>
{% endblock %}

